package DesignPatterns.FactoryMode.order;

import DesignPatterns.FactoryMode.coffee.AmericanCoffee;
import DesignPatterns.FactoryMode.coffee.Coffee;
import DesignPatterns.FactoryMode.coffee.LatteCoffee;


public class SimpleFactory {
    public Coffee CreatCoffee(String type){
        Coffee coffee=null;
        if("AmericanCoffee".equals(type)){
            coffee=new AmericanCoffee();
            coffee.setName("美式咖啡");
        }else if("LatteCoffee".equals(type)){
            coffee=new LatteCoffee();
            coffee.setName("拿铁咖啡");
        }return coffee;

    }
}
